/**********************************************************/
/* Goblin Defense - A tower defense game for Wii Homebrew */
/* Copyright (C) 2009 Ricardo Bueno Cordeiro              */
/* Licensed under de GNU General Public License v2.0      */
/*   See license_gplv2.txt for detalis                    */
/**********************************************************/

#include <gccore.h>
#include <math.h>

#include "hitter.h"
#include "../game.h"
#include "../map.h"
#include "../draw.h"
#include "../pony.h"

WeaponHitter::WeaponHitter(f32 xp, f32 yp) : x(xp), y(yp), throw_cool_time(0) {
}

void WeaponHitter::draw() {
	Sprite::draw_sprite(this->x, this->y, WEAPON_UPGRADABLE_SIZE, WEAPON_UPGRADABLE_SIZE, sprite_thrower);
}

void WeaponHitter::update(u32 step) {
	this->throw_cool_time += step;
}

int WeaponHitter::remove() {
	return 0;
}

f32 WeaponHitter::get_x() {
	return this->x;
}

f32 WeaponHitter::get_y() {
	return this->y;
}

f32 WeaponHitter::get_radius() {
	return 35.0;
}

int WeaponHitter::get_area_type() {
	return WEAPON_AREA_SINGLE;
}

void WeaponHitter::pony_near_by(Game *game, Pony *pony) {
	if (this->throw_cool_time < 500)
		return;

	pony->hit(game, 1, 0);
}

void WeaponHitter::draw_info() {
}

void WeaponHitter::click(f32 x, f32 y) {
}
